<template>
  <div>
    <van-swipe :autoplay="3000">
      <van-swipe-item v-for="(image, index) in images" :key="index">
        <img v-lazy="image" :style="{ height: height + 'px' }"/>
      </van-swipe-item>
    </van-swipe>
  </div>
</template>

<script>
import Vue from 'vue';
import { Lazyload } from 'vant';

Vue.use(Lazyload);

export default {
  props: {
    images: {
      type: Array,
      default() {
        return [
        'https://img01.yzcdn.cn/vant/apple-1.jpg',
        'https://img01.yzcdn.cn/vant/apple-2.jpg',
        ]
      }
    },
    height: {
      type: Number,
      default: 200
    }
  }
};
</script>

<style scoped>
img {
  width: 100%;
}
</style>